﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.Linq;
using System.Linq;
using System.Text;

namespace EBA.Data
{
    /// <summary>
    /// 领域事务
    /// </summary>
    public interface IUnitOfWork
    {
        /// <summary>
        /// 启动事务
        /// </summary>
        void BeginTransaction();

        /// <summary>
        /// 提交事务
        /// </summary>
        void CommitTransaction();

        /// <summary>
        /// 回滚事务
        /// </summary>
        void RollbackTransaction();

        /// <summary>
        /// 清理事务
        /// </summary>
        void EndTransaction();

        /// <summary>
        /// 提交修改
        /// </summary>
        void SubmitChanges();

        /// <summary>
        /// 更新成功事件
        /// </summary>
        event EventHandler SubmittedChanges;
    }
}
